/**
 * Created by Administrator on 2017/8/27.
 */



var seckillTpl=$('#seckill-template').html();
var seckillCmp=Handlebars.compile(seckillTpl);
var seckillnextCmp=Handlebars.compile();


var range = 200, //距下边界长度/单位px
    maxnum = 0, //设置课程总数
    num = 0, //当前数量
    totalheight = 0,
    flag=0,
    start='0',
    pageLength='5';

    function getSeckill(hourRange) {
        if (flag){
            return false;
        }

        $('.loading').show();
        flag=1;
        $.ajax({
            url:'',
            type:'get',
            dataType:'json',
            data:{
                hourRange:hourRange,
                token:C.token,
                start:start,
                length:pageLength
            },
            success:function (response) {
                if (response.result=='success'){
                    num++;
                    var data=response.list;
                    maxnum=data['totalRecords'];
                    start=num * pageLength;
                    if (maxnum == 0){
                        $('.no-info').show();
                    }
                    if (data.length>0){
                        if (num == 0){
                            $('#tab1').append(seckillCmp(data));
                        }
                        else{
                            $('#tab1').append();
                        }
                    }
                }
            }

        })

    }





